home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / bok-bndr.hqx / Bookbinder / card_6957.txt < prev    next >
Text File  |  1991-06-04  |  15KB  |  697 lines

  1. -- card: 6957 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 4755
  5. -- name: index
  6. ----- HyperTalk script -----
  7. on idle
  8.   if the scroll of card field "topic" is not the scroll of card field "card id" then
  9.     if the selectedField is "card field" && (the number of card field "topic") then
  10.       set the scroll of card field "card id" to the scroll of card field "topic"
  11.     else
  12.       set the scroll of card field "topic" to the scroll of card field "card id"
  13.     end if
  14.   end if
  15.   pass idle
  16. end idle
  17.  
  18. on returnInField
  19.   send returnInField to HyperCard
  20.   if word 2 of the selectedLine > the number of lines in card field (word 3 of the selectedField) then
  21.     type numToChar(32)
  22.     type numToChar(8)
  23.   end if
  24.   if (the scroll of card field "topic" is not the scroll of card field "card id") then
  25.     put the selectedLine into currentLine
  26.     if the selectedField is "card field" && (the number of card field "topic") then
  27.       set the scroll of card field "card id" to the scroll of card field "topic"
  28.     else
  29.       set the scroll of card field "topic" to the scroll of card field "card id"
  30.     end if
  31.     select before currentLine
  32.   end if
  33. end returnInField
  34.  
  35. on enterInField
  36.   send enterInField to HyperCard
  37.   if word 2 of the selectedLine > the number of lines in card field (word 3 of the selectedField) then
  38.     type numToChar(32)
  39.     type numToChar(8)
  40.   end if
  41.   if the scroll of card field "topic" is not the scroll of card field "card id" then
  42.     put the selectedLine into currentLine
  43.     if the selectedField is "card field" && (the number of card field "topic") then
  44.       set the scroll of card field "card id" to the scroll of card field "topic"
  45.     else
  46.       set the scroll of card field "topic" to the scroll of card field "card id"
  47.     end if
  48.     select before currentLine
  49.   end if
  50. end enterInField
  51.  
  52. function noBlanksFound
  53. set cursor to watch
  54. -- get rid of trailing blank lines:
  55. put true into inLoop
  56. repeat while inLoop
  57.   get the number of lines of card field "topic"
  58.   if line it of card field "topic" is "" and it > 0 then
  59.     select after line it+1 of card field "topic"
  60.     type the numToChar of 8
  61.   else
  62.     put false into inLoop
  63.   end if
  64. end repeat
  65. put true into inLoop
  66. repeat while inLoop
  67.   get the number of lines of card field "card id"
  68.   if line it of card field "card id" is "" and it > 0 then
  69.     select after line it+1 of card field "card id"
  70.     type the numToChar of 8
  71.   else
  72.     put false into inLoop
  73.   end if
  74. end repeat
  75. send idle
  76. -- continue function:
  77. put true into noBlanks
  78. get the number of lines of card field "topic"
  79. if it is the number of lines of card field "card id" then
  80.   put it into numLines
  81.   repeat with x=1 to numLines
  82.     get line x of card field "topic"
  83.     if it is "" or line x of card field "card id" is "" then
  84.       put false into noBlanks
  85.     end if
  86.   end repeat
  87. else
  88.   put false into noBlanks
  89. end if
  90. return noBlanks
  91. end noBlanksFound
  92.  
  93. on updateIndex
  94.   global deletedCard
  95.   set cursor to watch
  96.   put 1 into x
  97.   repeat until x > 18
  98.     get line x of card field "topic" of card "index"
  99.     if it is not "" then
  100.       if x > 1 then
  101.         if it is line x-1 of card field "topic" of card "index" then
  102.           get ""
  103.         end if
  104.       end if
  105.       put it into line x of card field "item" of card (the number of me)
  106.       get line x of card field "card id" of card "index"
  107.       if it is word 3 of deletedCard then
  108.         delete line x of card field "topic" of card "index"
  109.         delete line x of card field "card id" of card "index"
  110.         subtract 1 from x
  111.       else
  112.         get idToNumber(it)
  113.         put it into line x of card field "page" of card (the number of me)
  114.       end if
  115.     else
  116.       put "" into line x of card field "item" of card (the number of me)
  117.       put "" into line x of card field "page" of card (the number of me)
  118.     end if
  119.     add 1 to x
  120.   end repeat
  121.   put 1 into x
  122.   repeat until x > 18
  123.     get line x+18 of card field "topic" of card "index"
  124.     if it is not "" then
  125.       if x > 1 then
  126.         if it is line x+17 of card field "topic" of card "index" then
  127.           get ""
  128.         end if
  129.       end if
  130.       put it into line x of card field "item2" of card (the number of me)
  131.       get line x+18 of card field "card id" of card "index"
  132.       if it is word 3 of deletedCard then
  133.         delete line x+18 of card field "topic" of card "index"
  134.         delete line x+18 of card field "card id" of card "index"
  135.         subtract 1 from x
  136.       else
  137.         get idToNumber(it)
  138.         put it into line x of card field "page2" of card (the number of me)
  139.       end if
  140.     else
  141.       put "" into line x of card field "item2" of card (the number of me)
  142.       put "" into line x of card field "page2" of card (the number of me)
  143.     end if
  144.     add 1 to x
  145.   end repeat
  146.   put (the number of me) + 1 into nextCard
  147.   if nextCard <= the number of cards then
  148.     get the name of card nextCard
  149.     get word 2 of it
  150.     get char 2 to 6 of it
  151.     if it is "index" then
  152.       send updateIndex to card nextCard
  153.     end if
  154.   end if
  155. end updateIndex
  156.  
  157.  
  158.  
  159.  
  160. -- part 5 (field)
  161. -- low flags: 01
  162. -- high flags: 0000
  163. -- rect: left=14 top=60 right=300 bottom=182
  164. -- title width / last selected line: 0
  165. -- icon id / first selected line: 0 / 0
  166. -- text alignment: 0
  167. -- font id: 2
  168. -- text size: 10
  169. -- style flags: 0
  170. -- line height: 13
  171. -- part name: item
  172.  
  173.  
  174. -- part 17 (button)
  175. -- low flags: 00
  176. -- high flags: 0000
  177. -- rect: left=7 top=57 right=300 bottom=502
  178. -- title width / last selected line: 0
  179. -- icon id / first selected line: 0 / 0
  180. -- text alignment: 1
  181. -- font id: 0
  182. -- text size: 12
  183. -- style flags: 0
  184. -- line height: 16
  185. -- part name: 
  186.  
  187.  
  188. -- part 8 (field)
  189. -- low flags: 01
  190. -- high flags: 0000
  191. -- rect: left=99 top=37 right=55 bottom=339
  192. -- title width / last selected line: 0
  193. -- icon id / first selected line: 0 / 0
  194. -- text alignment: 0
  195. -- font id: 2
  196. -- text size: 10
  197. -- style flags: 0
  198. -- line height: 13
  199. -- part name: instructions
  200.  
  201.  
  202. -- part 6 (field)
  203. -- low flags: 01
  204. -- high flags: 0000
  205. -- rect: left=14 top=60 right=300 bottom=234
  206. -- title width / last selected line: 0
  207. -- icon id / first selected line: 0 / 0
  208. -- text alignment: 65535
  209. -- font id: 2
  210. -- text size: 10
  211. -- style flags: 0
  212. -- line height: 13
  213. -- part name: page
  214. ----- HyperTalk script -----
  215. on mousedown
  216.   set lockScreen to true
  217.   set lockText of me to false
  218.   click at the clickLoc
  219.   click at the clickLoc
  220.   get the selection
  221.   set lockText of me to true
  222.   set lockScreen to false
  223.   if it is not "" then
  224.     push card
  225.     global xrefdepth
  226.     add 1 to xrefdepth
  227.     visual iris open
  228.     show background button "return"
  229.     go card it
  230.   else
  231.     select empty
  232.   end if
  233. end mouseDown
  234.  
  235.  
  236. -- part 1 (button)
  237. -- low flags: 00
  238. -- high flags: A003
  239. -- rect: left=365 top=26 right=43 bottom=467
  240. -- title width / last selected line: 0
  241. -- icon id / first selected line: 0 / 0
  242. -- text alignment: 1
  243. -- font id: 0
  244. -- text size: 12
  245. -- style flags: 0
  246. -- line height: 16
  247. -- part name: Add Entry
  248. ----- HyperTalk script -----
  249. on mouseUp
  250.   set scroll of card field "topic" to 0
  251.   set scroll of card field "card id" to 0
  252.   show card button "beep"
  253.   show card button "Item"
  254.   show card button "Card ID"
  255.   show card field "topic"
  256.   show card field "card id"
  257.   hide card button "Add Entry"
  258.   show card button "Done Changes"
  259.   show card button "Alphabetize"
  260. end mouseUp
  261.  
  262.  
  263.  
  264. -- part 10 (field)
  265. -- low flags: 01
  266. -- high flags: 0000
  267. -- rect: left=274 top=60 right=300 bottom=442
  268. -- title width / last selected line: 0
  269. -- icon id / first selected line: 0 / 0
  270. -- text alignment: 0
  271. -- font id: 2
  272. -- text size: 10
  273. -- style flags: 0
  274. -- line height: 13
  275. -- part name: item2
  276.  
  277.  
  278. -- part 9 (field)
  279. -- low flags: 01
  280. -- high flags: 0000
  281. -- rect: left=274 top=60 right=300 bottom=494
  282. -- title width / last selected line: 0
  283. -- icon id / first selected line: 0 / 0
  284. -- text alignment: 65535
  285. -- font id: 2
  286. -- text size: 10
  287. -- style flags: 0
  288. -- line height: 13
  289. -- part name: page2
  290. ----- HyperTalk script -----
  291. on mousedown
  292.   set lockScreen to true
  293.   set lockText of me to false
  294.   click at the clickLoc
  295.   click at the clickLoc
  296.   get the selection
  297.   set lockText of me to true
  298.   set lockScreen to false
  299.   if it is not "" then
  300.     push card
  301.     global xrefdepth
  302.     add 1 to xrefdepth
  303.     visual iris open
  304.     show background button "return"
  305.     go card it
  306.   else
  307.     select empty
  308.   end if
  309. end mouseDown
  310.  
  311.  
  312. -- part 14 (button)
  313. -- low flags: 80
  314. -- high flags: 0000
  315. -- rect: left=1 top=21 right=340 bottom=510
  316. -- title width / last selected line: 0
  317. -- icon id / first selected line: 0 / 0
  318. -- text alignment: 1
  319. -- font id: 0
  320. -- text size: 12
  321. -- style flags: 0
  322. -- line height: 16
  323. -- part name: beep
  324. ----- HyperTalk script -----
  325. on mouseUp
  326.   beep
  327. end mouseUp
  328.  
  329.  
  330.  
  331. -- part 2 (button)
  332. -- low flags: 80
  333. -- high flags: A003
  334. -- rect: left=366 top=26 right=43 bottom=467
  335. -- title width / last selected line: 0
  336. -- icon id / first selected line: 0 / 0
  337. -- text alignment: 1
  338. -- font id: 0
  339. -- text size: 12
  340. -- style flags: 0
  341. -- line height: 16
  342. -- part name: Done Changes
  343. ----- HyperTalk script -----
  344. on mouseUp
  345.   if noBlanksFound() then
  346.     hide card button "beep"
  347.     hide card button "Item"
  348.     hide card button "Card ID"
  349.     hide card field "topic"
  350.     hide card field "card id"
  351.     hide card button "Done Changes"
  352.     show card button "Add Entry"
  353.     hide card button "Alphabetize"
  354.     show card field "updating"
  355.     send updateIndex
  356.     hide card field "updating"
  357.   else
  358.     answer "Blank field found."
  359.   end if
  360. end mouseUp
  361.  
  362.  
  363.  
  364. -- part 3 (field)
  365. -- low flags: 80
  366. -- high flags: 0007
  367. -- rect: left=115 top=98 right=281 bottom=292
  368. -- title width / last selected line: 0
  369. -- icon id / first selected line: 0 / 0
  370. -- text alignment: 0
  371. -- font id: 4
  372. -- text size: 9
  373. -- style flags: 0
  374. -- line height: 12
  375. -- part name: topic
  376.  
  377.  
  378. -- part 4 (field)
  379. -- low flags: 80
  380. -- high flags: 0007
  381. -- rect: left=275 top=98 right=281 bottom=350
  382. -- title width / last selected line: 0
  383. -- icon id / first selected line: 0 / 0
  384. -- text alignment: 0
  385. -- font id: 4
  386. -- text size: 9
  387. -- style flags: 0
  388. -- line height: 12
  389. -- part name: card id
  390.  
  391.  
  392. -- part 11 (button)
  393. -- low flags: 80
  394. -- high flags: 8002
  395. -- rect: left=115 top=78 right=100 bottom=277
  396. -- title width / last selected line: 0
  397. -- icon id / first selected line: 0 / 0
  398. -- text alignment: 1
  399. -- font id: 0
  400. -- text size: 12
  401. -- style flags: 0
  402. -- line height: 16
  403. -- part name: Item
  404.  
  405.  
  406. -- part 12 (button)
  407. -- low flags: 80
  408. -- high flags: 8002
  409. -- rect: left=275 top=78 right=100 bottom=350
  410. -- title width / last selected line: 0
  411. -- icon id / first selected line: 0 / 0
  412. -- text alignment: 1
  413. -- font id: 0
  414. -- text size: 12
  415. -- style flags: 0
  416. -- line height: 16
  417. -- part name: Card ID
  418.  
  419.  
  420. -- part 13 (button)
  421. -- low flags: 80
  422. -- high flags: A003
  423. -- rect: left=366 top=44 right=61 bottom=468
  424. -- title width / last selected line: 0
  425. -- icon id / first selected line: 0 / 0
  426. -- text alignment: 1
  427. -- font id: 0
  428. -- text size: 12
  429. -- style flags: 0
  430. -- line height: 16
  431. -- part name: Alphabetize
  432. ----- HyperTalk script -----
  433. on mouseUp
  434.   answer "Are you sure (may take several minutes)?" with "Go Ahead" or "Cancel"
  435.   if it is "Go Ahead" then
  436.     if noBlanksFound() then
  437.       put card field "topic" into tempt
  438.       put card field "card id" into tempd
  439.       set cursor to watch
  440.       show card field "busy"
  441.       put the number of lines of tempt into numLines
  442.       repeat with x=1 to numLines
  443.         if the mouse is "down" then
  444.           exit repeat
  445.         end if
  446.         repeat with y=x+1 to numLines
  447.           if the mouse is "down" then
  448.             exit repeat
  449.           end if
  450.           if line y of tempt < line x of tempt or (line y of tempt = line x of tempt and idToNumber(line y of tempd) < idToNumber(line x of tempd)) then
  451.             put line x of tempt into temp1
  452.             put line y of tempt into line x of tempt
  453.             put temp1 into line y of tempt
  454.             put line x of tempd into temp2
  455.             put line y of tempd into line x of tempd
  456.             put temp2 into line y of tempd
  457.           end if
  458.         end repeat
  459.       end repeat
  460.       hide card field "busy"
  461.       put tempt into card field "topic"
  462.       put tempd into card field "card id"
  463.     else
  464.       answer "Blank field found."
  465.     end if
  466.     beep
  467.   end if
  468. end mouseUp
  469.  
  470.  
  471.  
  472.  
  473. -- part 15 (field)
  474. -- low flags: 81
  475. -- high flags: 0004
  476. -- rect: left=101 top=143 right=188 bottom=364
  477. -- title width / last selected line: 0
  478. -- icon id / first selected line: 0 / 0
  479. -- text alignment: 0
  480. -- font id: 3
  481. -- text size: 12
  482. -- style flags: 0
  483. -- line height: 16
  484. -- part name: busy
  485.  
  486.  
  487. -- part 16 (field)
  488. -- low flags: 81
  489. -- high flags: 0004
  490. -- rect: left=156 top=120 right=205 bottom=356
  491. -- title width / last selected line: 0
  492. -- icon id / first selected line: 0 / 0
  493. -- text alignment: 0
  494. -- font id: 3
  495. -- text size: 12
  496. -- style flags: 0
  497. -- line height: 16
  498. -- part name: updating
  499.  
  500.  
  501. -- part contents for background part 7
  502. ----- text -----
  503. 19
  504.  
  505. -- part contents for background part 6
  506. ----- text -----
  507. Index
  508.  
  509. -- part contents for card part 5
  510. ----- text -----
  511. bookmarks
  512. buttons, adding
  513. buttons, deleting
  514. buttons, developer
  515.  
  516. card id
  517.  
  518. cards, adding
  519. cards, deleting
  520. compacting stack
  521. Contents, Table of
  522.  
  523.  
  524.  
  525. Contents (cont) card
  526.  
  527.  
  528. fields, adding
  529.  
  530. -- part contents for card part 6
  531. ----- text -----
  532. 6
  533. 14
  534. 14
  535. 7
  536. 9
  537. 7
  538. 9
  539. 11
  540. 11
  541. 15
  542. 6
  543. 7
  544. 13
  545. 15
  546. 7
  547. 11
  548. 15
  549. 13
  550.  
  551. -- part contents for card part 8
  552. ----- text -----
  553. (click on the topic or page no. of interest)
  554.  
  555. -- part contents for card part 9
  556. ----- text -----
  557. 13
  558. 6
  559. 7
  560. 11
  561. 8
  562. 11
  563. 15
  564. 6
  565. 8
  566. 7
  567. 9
  568. 11
  569. 5
  570. 4
  571. 7
  572. 8
  573. 9
  574. 13
  575.  
  576. -- part contents for card part 10
  577. ----- text -----
  578. fields, deleting
  579. footnotes
  580.  
  581. Help card
  582. Index (cont) card
  583.  
  584.  
  585. Index card
  586.  
  587. page numbers
  588.  
  589.  
  590. printing
  591. scripts
  592.  
  593.  
  594.  
  595.  
  596.  
  597. -- part contents for card part 15
  598. ----- text -----
  599. Alphabetizing...
  600. Hold down mouse button to stop.
  601.  
  602. -- part contents for card part 16
  603. ----- text -----
  604. Updating index.
  605. Please wait...
  606.  
  607. -- part contents for card part 3
  608. ----- text -----
  609. bookmarks
  610. buttons, adding
  611. buttons, deleting
  612. buttons, developer
  613. buttons, developer
  614. card id
  615. card id
  616. cards, adding
  617. cards, deleting
  618. compacting stack
  619. Contents, Table of
  620. Contents, Table of
  621. Contents, Table of
  622. Contents, Table of
  623. Contents (cont) card
  624. Contents (cont) card
  625. Contents (cont) card
  626. fields, adding
  627. fields, deleting
  628. footnotes
  629. footnotes
  630. Help card
  631. Index (cont) card
  632. Index (cont) card
  633. Index (cont) card
  634. Index card
  635. Index card
  636. page numbers
  637. page numbers
  638. page numbers
  639. printing
  640. scripts
  641. scripts
  642. scripts
  643. scripts
  644. scripts
  645. scripts
  646. Shafer, Dan
  647. Shafer, Dan
  648. user level
  649. user level
  650.  
  651. -- part contents for card part 4
  652. ----- text -----
  653. 4342
  654. 9080
  655. 9080
  656. 2542
  657. 6753
  658. 2542
  659. 6753
  660. 8539
  661. 8539
  662. 3295
  663. 4342
  664. 2542
  665. 8871
  666. 3295
  667. 2542
  668. 8539
  669. 3295
  670. 8871
  671. 8871
  672. 4342
  673. 2542
  674. 8539
  675. 5118
  676. 8539
  677. 3295
  678. 4342
  679. 5118
  680. 2542
  681. 6753
  682. 8539
  683. 7205
  684. 3971
  685. 2542
  686. 5118
  687. 6753
  688. 8871
  689. 3295
  690. 3971
  691. 2231
  692. 3971
  693. 3295
  694.  
  695. -- part contents for background part 17
  696. ----- text -----
  697. p6